package com.szeldon.declatest.declaration.settings;

import com.szeldon.utils.ValuesUtils;

/**
 * Declaration of WebServiceSecurity settings.
 * 
 * @author szeldon
 * 
 */
public class WebServiceSettingsPartDeclaration extends SettingsDeclaration {

    public static final String REQUIRED_WEB_SERVICE_SERVICE_NAME = "WebService";

    private String keystore;
    private String keypass;

    /**
     * Creates WebServiceSecurity settings declaration element.
     * 
     * @param id
     * @param description
     * @param keystore
     * @param keypass
     */
    public WebServiceSettingsPartDeclaration(String id, String description, String keystore, String keypass) {
        super(id, description);
        this.keystore = ValuesUtils.checkNamedValueForNull("keystore", keystore);
        this.keypass = ValuesUtils.checkNamedValueForNull("keypass", keypass);
    }

    /**
     * Creates WebServiceSecurity settings declaration element with only id and description set.
     * 
     * @param id
     * @param description
     */
    public WebServiceSettingsPartDeclaration(String id, String description) {
        super(id, description);
    }

    @Override
    public String getRequiredServiceName() {
        return REQUIRED_WEB_SERVICE_SERVICE_NAME;
    }

    public String getKeystore() {
        return keystore;
    }

    public String getKeypass() {
        return keypass;
    }

    public void setKeystore(String keystore) {
        this.keystore = keystore;
    }

    public void setKeypass(String keypass) {
        this.keypass = keypass;
    }
}
